﻿
using System;
using System.Collections;

namespace Xacml.Core.Context
{
  public class AttributeCollection : AttributeCollectionReadWrite
  {
    public override AttributeElementReadWrite this[int index]
    {
      get
      {
        return (AttributeElementReadWrite) this.List[index];
      }
      set
      {
        throw new NotSupportedException();
      }
    }

    public AttributeCollection(AttributeCollectionReadWrite items)
    {
      foreach (AttributeElementReadWrite elementReadWrite in (CollectionBase) items)
        this.List.Add((object) new AttributeElement(elementReadWrite.AttributeId, elementReadWrite.DataType, elementReadWrite.Issuer, elementReadWrite.IssueInstant, elementReadWrite.Value, elementReadWrite.SchemaVersion));
    }

    public AttributeCollection()
    {
    }

    public override int Add(AttributeElementReadWrite value)
    {
      return this.List.Add((object) new AttributeElement(value.AttributeId, value.DataType, value.Issuer, value.IssueInstant, value.Value, value.SchemaVersion));
    }

    public override void Clear()
    {
      throw new NotSupportedException();
    }

    public override void RemoveAt(int index)
    {
      throw new NotSupportedException();
    }
  }
}
